package server.business.pojo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author ccb
 * @date 2022/08/11
 *       血液入库信息
 */

@Data
@Accessors(chain = true)
@TableName("blood_inbound")
@ColumnWidth(20) // 列宽
@ContentRowHeight(20) // 数据行高
@HeadRowHeight(30) // 表头高
@ExcelIgnoreUnannotated // 解决不加ExcelProperty注解的，也会出现在excel中
public class BloodInBoundData {

    @TableId(type = IdType.AUTO)
    private Long id; // 编号

    @TableField(value = "gmt_create", fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtCreate; // 创建时间

    @TableField(value = "gmt_modified", fill = FieldFill.UPDATE)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date gmtModified; // 更新时间

    @TableField(value = "number")
    @ExcelProperty(value = "入库单据号", index = 0)
    private String number; // 入库单据号

    @TableField(value = "batch_number")
    @ExcelProperty(value = "入库批次号", index = 1)
    private Long batchNumber; // 入库批次号

    @TableField(value = "blood_number")
    @ExcelProperty(value = "血站发血单号", index = 2)
    private BigDecimal bloodNumber; // 血站发血单号

    @TableField(value = "serial_number")
    @ExcelProperty(value = "自编流水号", index = 3)
    private String serialNumber; // 自编流水号

    @TableField(value = "blood_source")
    @ExcelProperty(value = "血液来源", index = 4)
    private String bloodSource; // 血液来源

    @TableField(value = "inbound_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty(value = "入库日期", index = 5)
    private Date inboundTime; // 入库日期

    @TableField(value = "blood_message")
    private String bloodMessage; // 血液信息

    @TableField(value = "operator")
    @ExcelProperty(value = "操作者", index = 6)
    private String operator; // 操作者

    @TableField(value = "operator_id")
    @ExcelProperty(value = "操作人工号", index = 7)
    private String operatorId; // 操作者工号

    @TableField(value = "blood_money")
    @ExcelProperty(value = "血液金额", index = 8)
    private BigDecimal bloodMoney; // 血液金额

    @TableField(value = "is_deleted")
    private int isDeleted; // 删除标记

    @TableField(value = "blood_id")
    private String bloodId; // 血液信息表中的血液ID

    @TableField(exist = false)
    private String stateInfo; // 状态含义

    @TableField(exist = false)
    private static final long serialVersionUID = -5079977180009398830L;
}
